﻿using Avalonia.Controls;
using Avalonia.Interactivity;
using Klear.Library.ViewModels;
using Klear.Services;

namespace Klear.Views;

public partial class IncomeExpensesView : UserControl
{
    public IncomeExpensesView()
    {
        InitializeComponent();
    }
    private int i = 0;
    private void OpenDialog_OnClick(object? sender, RoutedEventArgs e)
    {
        // 弹窗新窗口
        DialogManage.Show((DialogType)i++, "大师风范"+i);
        if (i == 0)
        {
            i = 0;
        }
    }
    private void Delete(object? sender, RoutedEventArgs e)
    {
        IncomeExpensesViewModel viewModel = DataContext as IncomeExpensesViewModel;
        if (viewModel != null)
        {
            viewModel.DeleteIncomeExpense();
        }
    }
}